home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
editor
/
timelapse.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
4KB
|
136 lines
/* TimeLapse.rexx V3.0 -- Record frames at intervals of 1 to 60 mins */
/* By Bob Caron © 1995 NewTek Inc. (...It starts!) */
/* Based on an original script by Arnie Cachelin © 1992 NewTek Inc. */
OPTIONS RESULTS
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT' , 0)
call ADDLIB('ToasterARexx.port' , 0)
call set_view(2)
call req_error("TimeLapse V3.0 --- Record frames to a sequence of image files at intervals.")
rx startfilereq("Save Frames Where?","Toaster:Images","TimeLapse.Rgb")
exit=1
do while exit=1
name=queryfilereq()
if name=0 then call quit
if name~="" then exit=0
address command "c:wait 1"
end
call req_error("")
delay=0
do while(delay<1)
delay=req_number("Delay In Seconds",'30')
if delay="CANCEL" then call quit()
end
tdelay=delay
if delay<30 then if req_tell("Warning!","There is a good chance I can't","save images fast enough for","the dely time you entered.")=0 then call quit
call req_error("Example: 150 frames = 5 seconds.")
count=0
do while(count<1)
count=req_number("Number Of Frames To Grab",150)
if count="CANCEL" then call quit()
end
call req_error("")
vidinput="-1"
buttons='1000'
do while vidinput="-1"
buttons=req_buttons("Choose Input:",buttons,"Main 1","Main 2","Main 3","Main 4")
if buttons="CANCEL" then call quit
if buttons="1000" then do
vidinput="001"
end
if buttons="0100" then do
vidinput="002"
end
if buttons="0010" then do
vidinput="003"
end
if buttons="0001" then do
vidinput="004"
end
end
format=-1
buttons='10'
do while format=-1
buttons=req_buttons("Choose File Format:",buttons,"24Bit IFF","Framestore")
if buttons="CANCEL" then call quit
if buttons="10" then do
format=0
end
if buttons="01" then do
format=1
end
end
if req_tell("Click 'Continue' to begin.")=0 then call quit
inputp="P"||vidinput
inputm="M"||vidinput
if delay="" then delay = 1
if delay<1 then delay = 1
if delay>60 then delay = 60
if count="" then count=10
if count>1000 then count=1000
if name="" then name=left(date(),6)
/*delay=delay*60*/ /* <- By request of P.L. I am ditching the minute */
/* restriction... SEE! We listen! Although I am not */
/* sure it will work out well with save time being */
/* what it is! :) */
Switcher(TOSW) /* Go to Switcher screen */
Switcher(inputp)
Switcher(inputm)
Switcher(LVID) /* Set to live digital video */
call req_open("Working.... Please wait.")
f=1
call req_error("TimeLapse: Current Frame ("||right(f,3,'0')||") Frames to go ("||count-f||") Delay ("||delay||")")
do f=1 to count
Switcher(FVID) /* Freeze frame */
fname=strip(name)||"."||right(f,3,'0')
call req_close()
call req_open("Working.... Please wait.")
call req_error("TimeLapse: Current Frame ("||right(f,3,'0')||") Frames to go ("||count-f||") Delay ("||delay||")")
SaveNextFrame(fname,format)
Switcher(LVID) /* Set to live digital video */
address command "C:Wait "||delay
end
call req_close()
call req_error("")
call req_error("All done.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
SaveNextFrame: Procedure
arg name,format
if format=0 then
t=switcher(SRGB,name,4,0)
else
t=switcher(FMSV,name,4)
return t
quit:
call req_error("Canceled.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit